package com.hyts.standard.webflux.handler;

import com.alibaba.fastjson.JSONObject;
import com.hyts.standard.webflux.bean.dto.UserDTO;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.web.reactive.function.BodyInserters;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

/**
 * project-name:standard-webflux
 * package-name:com.hyts.standard.webflux.handler
 * author:Libo/Alex
 * create-date:2019-06-19 10:08
 * email:liboware@gmail.com
 * description:此类主要用于:
 */
public class SystemHandler {



    public static Mono<ServerResponse> serverInfo(ServerRequest request) {
        return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN)
                .body(BodyInserters.fromObject(JSONObject.toJSON(new UserDTO())));
    }

}
